package ua.edu.sumdu.j2se.roman.lab1.view.console;

import ua.edu.sumdu.j2se.roman.lab1.domain.Task;
import ua.edu.sumdu.j2se.roman.lab1.domain.TaskList;
import ua.edu.sumdu.j2se.roman.lab1.view.ListView;

/**
 * Author: Radko Roman.
 */

/**
 * Responsible for show user on the console all task in list.
 *
 */
public class ConsoleListView implements ListView {
    /**
     * Show user all task in list if list isn't empty and close list view.
     *
     * @param tasks list
     */
    @Override
    public void show(TaskList tasks) {
        if (tasks.size() == 0) {
            System.out.println("List is empty.");
        }
        for (Task t : tasks) {
            System.out.println(t);
        }
    }

}
